package start.doubudouyin.mapper;

import start.doubudouyin.entity.Follow;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.io.Serializable;
import java.util.List;

/**
* @author mmmm
* @description 针对表【follow(关注表)】的数据库操作Mapper
* @createDate 2025-06-09 14:04:30
* @Entity start.doubudouyin.entity.Follow
*/
public interface FollowMapper extends BaseMapper<Follow> {
    Follow isFollow(String followerId,String followedId);
    Integer GetFollowedCount(String userId);
    Integer GetFansCount(String userId);
    List<String> getfirendId(String followerId);
    List<String> getfollowedId(String followerId);
    Boolean isFollowed(String followerId,String followedId);
    Boolean isFriend(String followerId,String followedId);
    Integer removeFollowed(String followerId,String followedId);

    /**
     * 用于渲染聊天室好友列
     * 获取关注的用户，以及作为被关注者时，chat=1时的关注用户id
     */
    List<String> getfollowedIdAndChat1(String userId);
    // 发消息后更新chat
    void updatechat(String senderId, String receiverId);

    //关注了userId的所有人和UserId关注了的并且chat=1的人
    List<String> getfollowers(String userId);
}




